package org.pfc.porlapatilla.model;

import java.util.List;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * This class represents an application user.
 * 
 * @author jorgepolobermudez
 * 
 */
@Document
public class User {

    /**
     * The user id.
     */
    @Id
    private String id;

    /**
     * The user name.
     */
    private String name;

    /**
     * The user surname.
     */
    private String surname;

    /**
     * The user nick.
     */
    private String nick;

    /**
     * The user email.
     */
    private String email;

    /**
     * The user password.
     */
    private String password;

    /**
     * The user roles.
     */
    private List<String> roles;

    /**
     * The user address.
     */
    private Address address;

    /**
     * The user location.
     */
    private double[] location;

    /**
     * Default constructor.
     */
    public User() {
	super();
    }

    /**
     * Creates a new User.
     * 
     * @param name
     *            The new user name.
     * @param surname
     *            The new user surname.
     * @param email
     *            The new user email.
     * @param password
     *            The new user password.
     * @param roles
     *            The new user roles.
     * @param address
     *            The new user address.
     * @param location
     *            The new user location.
     */
    public User(String name, String surname, String nick, String email,
	    String password, List<String> roles, Address address,
	    double[] location) {
	this.name = name;
	this.surname = surname;
	this.nick = nick;
	this.email = email;
	this.password = password;
	this.roles = roles;
	this.address = address;
	this.location = location;
    }

    /**
     * Get the user id.
     * 
     * @return The user id.
     */
    public String getId() {
	return id;
    }

    /**
     * Set the user id.
     * 
     * @param id
     *            The user id to set.
     */
    public void setId(String id) {
	this.id = id;
    }

    /**
     * Get the user name.
     * 
     * @return The user name.
     */
    public String getName() {
	return name;
    }

    /**
     * Set the user name.
     * 
     * @param name
     *            The user name to set.
     */
    public void setName(String name) {
	this.name = name;
    }

    /**
     * Get the user surname.
     * 
     * @return The user surname.
     */
    public String getSurname() {
	return surname;
    }

    /**
     * Set the user surname.
     * 
     * @param surname
     *            The user surname to set.
     */
    public void setSurnname(String surname) {
	this.surname = surname;
    }

    /**
     * @return the nick
     */
    public String getNick() {
	return nick;
    }

    /**
     * @param nick
     *            the nick to set
     */
    public void setNick(String nick) {
	this.nick = nick;
    }

    /**
     * Get the user email.
     * 
     * @return The user email.
     */
    public String getEmail() {
	return email;
    }

    /**
     * Set the user surname.
     * 
     * @param email
     *            The user email to set.
     */
    public void setEmail(String email) {
	this.email = email;
    }

    /**
     * Get the user address.
     * 
     * @return The user address.
     */
    public Address getAddress() {
	return address;
    }

    /**
     * Set the user address.
     * 
     * @param address
     *            The user address to set.
     */
    public void setAddress(Address address) {
	this.address = address;
    }

    /**
     * Get the user location.
     * 
     * @return The user location.
     */
    public double[] getLocation() {
	return this.location;
    }

    /**
     * Set the user location.
     * 
     * @param location
     *            The user location to set.
     */
    public void setLocation(double[] location) {
	this.location = location;
    }

    /**
     * Get the user password.
     * 
     * @return The user password
     */
    public String getPassword() {
	return password;
    }

    /**
     * Set the user password.
     * 
     * @param password
     *            The password to set.
     */
    public void setPassword(String password) {
	this.password = password;
    }

    /**
     * Get the user roles.
     * 
     * @return the user roles.
     */
    public List<String> getRoles() {
	return roles;
    }

    /**
     * Set the user roles.
     * 
     * @param roles
     *            the roles to set.
     */
    public void setRoles(List<String> roles) {
	this.roles = roles;
    }

}
